using UnityEngine;

public class ShowgameObjectsFromPercent : MonoBehaviour
{
	[SerializeField]
	private UISprite[] showingObjs;

	public void SetPertcent(float percent)
	{
		for (int i = 0; i < showingObjs.Length; i++)
		{
			if (percent != 0f)
			{
				if (i == 0)
				{
					showingObjs[i].alpha = 1f;
				}
				else
				{
					showingObjs[i].alpha = (((float)i < (float)showingObjs.Length / percent) ? 1 : 0);
				}
			}
			else
			{
				showingObjs[i].alpha = 0f;
			}
		}
	}
}
